From: | Rolf Max Rotvel |
Date: | 6 Sep 2001 at 14:34:01 |
Subject: | Re: Starting programs, waiting for execution |
On 6 Sep 2001, at 17:45, Craig Hutchison wrote:
> >> A simpler way to wait for a port to appear would be be to use the,
> >> umm, WaitForPort command.
>
> AR> A more simpler way is to use
> AR> rmh.library/PORTWAIT(<portName>,[secs/N])
>
> Ooooh. I hadn't found this one. Thanks.
Or you can easily create a procedure yourself:
(This procedure requires rexxsupport.library -
call addlib('rexxsupport.library', 0, -30 , 0))
PORTWAIT: procedure
parse arg port, secs
if show('p', port) then return 1
/* Default to 10 secs */
if secs = '' then secs = 10
do (secs * 2)
call delay(25) /* Wait 1/2 sec */
if show('p', port) then return 1
end
return 0
Use it like this:
address command 'run >nil: <some_prog>'
if ~portwait(<some_port>) or ~portwait(<some_port>, 20) then do
say 'Error starting '<some_prog>
exit
end
Regards
Rolf Max Rotvel
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE VeriSign guide to security solutions for your web site: encrypting transactions, securing intranets, and more!
http://us.click.yahoo.com/XrFcOC/m5_CAA/yigFAA/saFolB/TM
---------------------------------------------------------------------~->
ARexx mailing list - No flames, no overquoting, no crossposting.
Unsub: Blank mail to mailto:arexx-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/